using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._EditingTools
{
    /// <summary>
    /// <para>Trim Line</para>
    /// <para>Removes portions of a line that extend a specified distance past a line intersection (dangles). Any line that does not touch another line at both endpoints can be trimmed, but only the portion of the line that extends past the intersection by the specified distance will be removed.</para>
    /// <para>移除线中延伸指定距离超过线交点的部分（悬垂）。可以修剪在两个端点处不接触另一条线的任何线，但仅删除线中超出交点指定距离的部分。</para>
    /// </summary>    
    [DisplayName("Trim Line")]
    public class TrimLine : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TrimLine()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The line input features to be trimmed.</para>
        /// <para>要修剪的线路输入要素。</para>
        /// </param>
        public TrimLine(object _in_features)
        {
            this._in_features = _in_features;
        }
        public override string ToolboxName => "Editing Tools";

        public override string ToolName => "Trim Line";

        public override string CallName => "edit.TrimLine";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_features, _dangle_length, _delete_shorts.GetGPValue(), _out_feature_class];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The line input features to be trimmed.</para>
        /// <para>要修剪的线路输入要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Dangle Length</para>
        /// <para><xdoc>
        ///   <para>Line segments that are shorter than the specified dangle length and do not touch another line at both endpoints (dangles) will be trimmed.</para>
        ///   <para>If a dangle length is not specified, all dangling lines (line segments that do not touch another line at both endpoints), regardless of length, will be trimmed back to the point of intersection.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>短于指定悬垂长度且在两个端点（悬垂）处不接触另一条线的线段将被修剪。</para>
        ///   <para>如果未指定悬垂长度，则所有悬垂线（在两个端点处不接触另一条线的线段）无论长度如何，都将修剪回交点。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dangle Length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _dangle_length { get; set; } = null;


        /// <summary>
        /// <para>Delete Short Features</para>
        /// <para><xdoc>
        ///   <para>Specifies whether line segments which are less than the dangle length and are free-standing will be deleted.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Delete short free-standing features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Do not delete short free-standing features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否删除小于悬垂长度且独立式的线段。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 删除短独立要素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不删除短的独立要素。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Delete Short Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _delete_shorts_value _delete_shorts { get; set; } = _delete_shorts_value._true;

        public enum _delete_shorts_value
        {
            /// <summary>
            /// <para>DELETE_SHORT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DELETE_SHORT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_SHORT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_SHORT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        public TrimLine SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}